package com.ht.medicaltreatment.view

import android.content.Context
import android.text.TextUtils
import com.ht.medicaltreatment.R
import kotlinx.android.synthetic.main.dialog_shenpi_layout.btnCreate
import kotlinx.android.synthetic.main.dialog_shenpi_layout.etContent

class ShenPiDailog(context:Context):BaseDialog(context, height = 600f) {
    override fun getLayoutRes(): Int {
        return R.layout.dialog_shenpi_layout
    }

    fun show(onClick:(String)->Unit){
        show()
        btnCreate.setOnClickListener {
           val content = etContent.text.toString()
            if(TextUtils.isEmpty(content)){
                return@setOnClickListener
            }
            dismiss()
            onClick(content)
        }
    }
}